package com.dorado.example.client;

import com.dorado.example.dto.UserDto;
import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 *
 * hydra.order在ms子项目的application-dev.properties配置
 *
 * 用法：
 *
 *
 */
//@FeignClient(value = UserServiceApi.SERVICE_NAME, url = "${hydra.example}")
public interface UserServiceApi {

    String SERVICE_NAME = "user-service";

    @RequestLine("GET /display/queryBusiness")
    String query();


    /**
     * 修改用户密码 表单形式提交
     * @param values
     * @return
     */
    @RequestLine("POST /center/user/resetPassword")
    //@Headers("Content-Type: application/x-www-form-urlencoded")
    Map<String, Object> resetUserPassword(@QueryMap Map<String, Object> values);

    /**
     * 修改用户密码 表单形式提交
     * @param values
     * @return
     */
    @RequestLine("POST /center/user/modifyPassword")
    //@Headers("Content-Type: application/x-www-form-urlencoded")
    Map<String, Object> resetUserPwd(@QueryMap Map<String, Object> values);


    /**
     * 修改用户手机号 主键ID，手机号码
     * @param userInfoDto 用户信息
     * @return
     */
    @RequestLine("POST /center/user/updateUserPhone")
    @Headers("Content-Type: application/json")
    Map<String, Object> updateUserPhoneById(@RequestBody UserDto userInfoDto);


    /**
     * 验证用户名
     */
    @RequestLine("GET /center/user/checkUsername?username={username}")
    Map<String, Object> checkUserName(@Param("username") String username);


}
